<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Twisted Web code examples</title>
</head>

<body>
    <h1>Twisted Web code examples</h1>

    <h2>twisted.web.client</h2>
    <ul>
        <li><a href="getpage.py">getpage.py</a> - use
        <code>twisted.web.client.getPage</code> to download a web
        page.</li>
        <li><a href="dlpage.py">dlpage.py</a> - add callbacks to
        <code>twisted.web.client.downloadPage</code> to display errors
        that occur when downloading a web page</li>
    </ul>

    <h2>XML-RPC</h2>
    <ul>
        <li><a href="xmlrpc.py">xmlrpc.py</a> XML-RPC server with
        several methods, including echoing, faulting, returning
        deferreds and failed deferreds</li>
        <li><a href="xmlrpcclient.py">xmlrpcclient.py</a> - use
        <code>twisted.web.xmlrpc.Proxy</code> to call remote XML-RPC
        methods</li>
        <li><a href="advogato.py">advogato.py</a> - use
        <code>twisted.web.xmlrpc</code> to post a diary entry to
        advogato.org; requires an advogato account</li>
    </ul>

    <h2>Virtual hosts and proxies</h2>
    <ul>
        <li><a href="proxy.py">proxy.py</a> -
        use <code>twisted.web.proxy.Proxy</code> to make the simplest
        proxy</li>
        <li><a href="logging-proxy.py">logging-proxy.py</a> - example of
        subclassing the core classes of <code>twisted.web.proxy</code>
        to log requests through a proxy</li>
        <li><a href="reverse-proxy.py">reverse-proxy.py</a> - use
        <code>twisted.web.proxy.ReverseProxyResource</code> to make
        any HTTP request to the proxy port get applied to a specified
        website</li>
        <li><a href="rootscript.py">rootscript.py</a> - example use of
        <code>twisted.web.vhost.NameVirtualHost</code></li>
        <li><a href="web.py">web.py</a> - an example of both using the
        <code>processors</code> attribute to set how certain file types
        are treated and using
        <code>twisted.web.vhost.VHostMonsterResource</code> to reverse
        proxy</li>
    </ul>

    <h2>.rpys and ResourceTemplate</h2>
    <ul>
        <li><a href="hello.rpy.py">hello.rpy.py</a> - use
        <code>twisted.web.static</code> to create a static resource to
        serve</li>
        <li><a href="fortune.rpy.py">fortune.rpy.py</a> - create a
        resource that returns the output of a process run on the
        server</li>
        <li><a href="lj.rpy.py">lj.rpy.py</a> - use
        <code>twisted.web.microdom</code>,
        <code>twisted.web.domhelpers</code>, and chained callbacks to
        extract and display parts of a livejournal user's rss page</li>
        <li><a href="report.rpy.py">report.rpy.py</a> - display
        various properties of a resource, including path, host, and
        port</li>
        <li><a href="users.rpy.py">users.rpy.py</a> - use
        <code>twisted.web.distrib</code> to publish user directories
        as for a "community web site"</li>
        <li><a href="simple.rtl">simple.rtl</a> - example use of
        <code>twisted.web.resource.ResourceTemplate</code></li>
    </ul>

    <h2>Miscellaneous</h2>
    <ul>
        <li><a href="webguard.py">webguard.py</a> - pairing
        <code>twisted.web</code> with <code>twisted.cred</code> to
        guard resources against unauthenticated users</li>
        <li><a href="silly-web.py">silly-web.py</a> - bare-bones
        distributed web setup with a master and slave using
        <code>twisted.web.distrib</code> and
        <code>twisted.spread.pb</code></li>
        <li><a href="soap.py">soap.py</a> - use
        <code>twisted.web.soap</code> to publish SOAP methods</li>
    </ul>

</body>
</html>
